﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;


namespace Sublimation
{
    public abstract class Menu : GameObject
    {
        protected List<MenuItem> menuItems = new List<MenuItem>();
        protected Texture2D texture;
        protected Game game;
        protected float rotationAngle = 0.0f;
        protected const float sideMargin = 20f;
        protected const float itemMargin = 30.0f;

        public Menu(WorldProperties worldProperties)
            : base(worldProperties)
        {
            Scale = 1.0f;
            DrawOrder = 60;
        }

        public List<MenuItem> MenuItemList
        {
            set { menuItems = value; }
            get
            {
                return menuItems;
            }
        }


        public void SetVisible(bool visible)
        {
            this.Visible = visible;

            foreach (MenuItem aItem in menuItems)
            {
                aItem.Visible = visible;
            }
        }

        #region GameObject implementation

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        protected override void LoadContent()
        {
            sprite = Game.Content.Load<Texture2D>("Menu");
            base.LoadContent();
        }


        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);
        }


        #endregion

    }
}

